package builder;

/**
 * @Description: 工具类
 * 用于封装数据 如查询条件等
 * @Project: cf-service
 * @Author: hjibo
 * @CreateDate: 2019/1/30 15:39
 * @ModificationHistory: （who whatTime doWhat）
 */
public class Condition implements Cloneable{

    private String str1;
    private String str2;
    private String str3;
    private String str4;
    private String str5;
    private String str6;
    private String str7;
    private String str8;
    private String str9;
    private String str10;

    // 私有构造器，限制了在外部创建实例
    private Condition(Builder Builder) {
        this.str1 = Builder.str1;
        this.str2 = Builder.str2;
        this.str3 = Builder.str3;
        this.str4 = Builder.str4;
        this.str5 = Builder.str5;
        this.str6 = Builder.str6;
        this.str7 = Builder.str7;
        this.str8 = Builder.str8;
        this.str9 = Builder.str9;
        this.str10 = Builder.str10;
    }

    // 静态内部类
    public static class Builder{
        private String str1;
        private String str2;
        private String str3;
        private String str4;
        private String str5;
        private String str6;
        private String str7;
        private String str8;
        private String str9;
        private String str10;

        public Builder setStr1(String str1) {
            this.str1 = str1;
            return this;
        }

        public Builder setStr2(String str2) {
            this.str2 = str2;
            return this;
        }

        public Builder setStr3(String str3) {
            this.str3 = str3;
            return this;
        }

        public Builder setStr4(String str4) {
            this.str4 = str4;
            return this;
        }

        public Builder setStr5(String str5) {
            this.str5 = str5;
            return this;
        }

        public Builder setStr6(String str6) {
            this.str6 = str6;
            return this;
        }

        public Builder setStr7(String str7) {
            this.str7 = str7;
            return this;
        }

        public Builder setStr8(String str8) {
            this.str8 = str8;
            return this;
        }

        public Builder setStr9(String str9) {
            this.str9 = str9;
            return this;
        }

        public Builder setStr10(String str10) {
            this.str10 = str10;
            return this;
        }

        // 通过静态类创建外部类实例
        public Condition build(){
            return new Condition(this);
        }
    }

    // 为外部类提供getter方法
    public String getStr1() {
        return str1;
    }

    public String getStr2() {
        return str2;
    }

    public String getStr3() {
        return str3;
    }

    public String getStr4() {
        return str4;
    }

    public String getStr5() {
        return str5;
    }

    public String getStr6() {
        return str6;
    }

    public String getStr7() {
        return str7;
    }

    public String getStr8() {
        return str8;
    }

    public String getStr9() {
        return str9;
    }

    public String getStr10() {
        return str10;
    }

    // 为外部类提供setter方法
    public void setStr1(String str1) {
        this.str1 = str1;
    }

    public void setStr2(String str2) {
        this.str2 = str2;
    }

    public void setStr3(String str3) {
        this.str3 = str3;
    }

    public void setStr4(String str4) {
        this.str4 = str4;
    }

    public void setStr5(String str5) {
        this.str5 = str5;
    }

    public void setStr6(String str6) {
        this.str6 = str6;
    }

    public void setStr7(String str7) {
        this.str7 = str7;
    }

    public void setStr8(String str8) {
        this.str8 = str8;
    }

    public void setStr9(String str9) {
        this.str9 = str9;
    }

    public void setStr10(String str10) {
        this.str10 = str10;
    }

    @Override
    public String toString() {
        return "Condition{" +
                "str1='" + str1 + '\'' +
                ", str2='" + str2 + '\'' +
                ", str3='" + str3 + '\'' +
                ", str4='" + str4 + '\'' +
                ", str5='" + str5 + '\'' +
                ", str6='" + str6 + '\'' +
                ", str7='" + str7 + '\'' +
                ", str8='" + str8 + '\'' +
                ", str9='" + str9 + '\'' +
                ", str10='" + str10 + '\'' +
                '}';
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
